<?php

namespace Deployer;

require 'recipe/common.php';

// Project name
set('application', 'myapp');

// Project repository
set('repository', 'git@gitee.com:baicai001/test01.git');

// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);

// Shared files/dirs between deploys 
set('shared_files', []);
set('shared_dirs', []);

// Writable dirs by web server 
set('writable_dirs', []);


// Hosts
host('production')
    ->hostname('test.love.com')
    ->set('deploy_path', '/var/www2/{{application}}');

host('beta')
    ->hostname('test.love.com')
    ->set('deploy_path', '/var/www2/{{application}}');



// Tasks

desc('Deploy your project');
task('deploy', [
    'deploy:info',
    'deploy:prepare',
    'deploy:lock',
    'deploy:release',
    'deploy:update_code',
    'deploy:shared',
    'deploy:writable',
    'deploy:vendors',
    'deploy:clear_paths',
    'deploy:symlink',
    'deploy:unlock',
    'cleanup',
    'success'
]);

// [Optional] If deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');

set('current_path', function () {
    return run('pwd');
});

desc('My task');
task('my_task', function () {
    run('echo "GG" > ss');
})->onStage('test');

task('echo:gg', function () {
    run('echo "GG"');
});

after('my_task', 'echo:gg');


